package com.rc.pojo.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class AreaTableDef extends TableDef {

    /**
     * 实体类。

 @author 27806
 @since 2024-06-15
     */
    public static final AreaTableDef AREA = new AreaTableDef();

    /**
     * 园区id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    public final QueryColumn LAT = new QueryColumn(this, "lat");

    public final QueryColumn LNG = new QueryColumn(this, "lng");

    /**
     * 园区名称
     */
    public final QueryColumn NAME = new QueryColumn(this, "name");

    /**
     * 园区大小单位m2
     */
    public final QueryColumn SIZE = new QueryColumn(this, "size");

    /**
     * 封面url
     */
    public final QueryColumn COVER = new QueryColumn(this, "cover");

    public final QueryColumn FARM_ID = new QueryColumn(this, "farm_id");

    public final QueryColumn ADDRESS = new QueryColumn(this, "address");

    /**
     * 种植植物
     */
    public final QueryColumn PLANT_ID = new QueryColumn(this, "plant_id");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    public final QueryColumn CREATE_USER = new QueryColumn(this, "create_user");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    public final QueryColumn UPDATE_USER = new QueryColumn(this, "update_user");

    /**
     * 简介
     */
    public final QueryColumn DESCRIPTION = new QueryColumn(this, "description");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, LAT, LNG, NAME, SIZE, COVER, FARM_ID, ADDRESS, PLANT_ID, CREATE_TIME, CREATE_USER, UPDATE_TIME, UPDATE_USER, DESCRIPTION};

    public AreaTableDef() {
        super("rc", "area");
    }

    private AreaTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public AreaTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new AreaTableDef("rc", "area", alias));
    }

}
